//
//  GDFiterCellModel.h
//  GridGovernance
//
//  Created by 吴欧 on 2017/11/22.
//  Copyright © 2017年 Bitvalue. All rights reserved.
//

#import "MCTableBaseMetadata.h"
#import "BRDatePickerView.h"

typedef NS_ENUM(NSUInteger, GDFiterCellType) {
    GDFiterCellTypeSelect_PK ,
    GDFiterCellTypeSelect_TEXT ,
    GDFiterCellTypeSelect_TEXTView,
    GDFiterCellTypeSelect_MAP ,
    GDFiterCellTypeSelect_ADDPHOTO,
    GDFiterCellTypeSelect_TIME ,
    GDFiterCellTypeSelect_Radio ,
    
    GDFiterCellTypeGoodsDetailsTitle,
    GDFiterCellTypeGoodsDetailsRefuse,
    GDFiterCellTypeGoodsDetailsSku,
    GDFiterCellTypeGoodsDetailsCommentHeader,
    GDFiterCellTypeGoodsDetailsComment,
    GDFiterCellTypeGoodsDetailsNoComments,
    GDFiterCellTypeGoodsDetailsHtml,
    GDFiterCellTypeGoodsDetailsCompany,
    GDFiterCellTypeGoodsDetailsArea,
    GDFiterCellTypeGoodsDetailsRecom,

    /* 创建订单 */
    GDFiterCellTypeOrderAddAddress, //
    GDFiterCellTypeOrderHasAddress, // 有地址
    GDFiterCellTypeOrderGoodsHead,  //
    GDFiterCellTypeOrderGoods,  //
    GDFiterCellTypeOrderGoodsFooter,  //
    GDFiterCellTypeOrderLeaveMsg,  //
    GDFiterCellTypeOrderServerTime,  //
    GDFiterCellTypeOrderDispatch,  //
    GDFiterCellTypeOrderPay,  //
    GDFiterCellTypeOrderWxPay,  //
    GDFiterCellTypeOrderAliPay,  //

    /* 订单详请 */
    GDFiterCellTypeOrderDetailsAddres,  // 
    GDFiterCellTypeOrderDetailsGoods,  //
    GDFiterCellTypeOrderDetailsGoodsOperation,  //
    GDFiterCellTypeOrderDetailsGoodsFooter,
    GDFiterCellTypeOrderDetailsDoctorInfo,  //
    GDFiterCellTypeOrderDetailsServicePersonInfo,  //
    GDFiterCellTypeOrderDetailsOrderInfo,  //
    GDFiterCellTypeOrderDetailsHead,  //
    GDFiterCellTypeOrderDetailsAddOrder,  //

    /* 评论页 */
    GDFiterCellTypeCommentGood,  //
    GDFiterCellTypeCommentTextView,  //
    GDFiterCellTypeCommentPhoto,  //
    GDFiterCellTypeCommentScore,  //
    
    
    // 设置页
    GDFiterCellTypeSettingPublic,  //
    GDFiterCellTypeSettingPublicDetail,  //
    GDFiterCellTypeSettingSwitch,  //
    GDFiterCellTypeSettingAddres,  //
    GDFiterCellTypeSettingUsernameSafe,  //
    GDFiterCellTypeSettingInfoNotice,  //
    GDFiterCellTypeSettingFont,  //
    GDFiterCellTypeSettingCache,  //
    GDFiterCellTypeSettingLogout,  //
    GDFiterCellTypeSettingGesturePWD,  //
    GDFiterCellTypeSettingFingerprintPWD,  //

    
    // 医生详请页
    GDFiterCellTypeDoctorServer,  //
    GDFiterCellTypeDoctorServerDetails,  //
    GDFiterCellTypeDoctorSign,  //
    GDFiterCellTypeDoctorCommentHead,  //
    GDFiterCellTypeDoctorComment,  //

    // 医生订单
    GDFiterCellTypeDoctorOrderItem,  //
    GDFiterCellTypeDoctorOrderHead,
    GDFiterCellTypeGoodPrefer,   // 优惠选择
    GDFiterCellTypeGoodTransFeesInfo,   // 交通费用
};

typedef NS_ENUM(NSUInteger, GDFiterCellRegisterType) {
    GDFiterCellRegisterByClass,
    GDFiterCellRegisterByXib,
};



typedef NS_ENUM(NSUInteger, GDPickerType) {
    GDPickerType_String = 0,
    GDPickerType_Address,
    GDPickerType_Date,
};

typedef NS_ENUM(NSUInteger, GDCellDisplayType) {
    GDCellDisplayNone, // 不注册不显示cell
    GDCellDisplayShow, // 注册显示cell
};

typedef NS_ENUM(NSUInteger, GDCellPhotoManagerSelectedType) {
    GDCellPhotoManagerSelectedTypePhoto, //!< 只显示图片
    GDCellPhotoManagerSelectedTypeVideo, //!< 只显示视频
    GDCellPhotoManagerSelectedTypePhotoAndVideo //!< 图片和视频一起显示
};


/**
 cell类型及数据描述model
 👇：
 该类仅仅描述cell，不作为cell操作数据用，操作数据使用GDFormModel！！！
 */
@interface GDFiterCellModel : MCTableBaseMetadata

#pragma mark - 代理配置，表单弱引用
@property (nonatomic, weak) UIViewController *proxyVC;

/// 左标题
@property (nonatomic, copy) NSString *leftTitle;

/// 左标题颜色
@property (nonatomic, strong) UIColor *leftTitleColor;

/// 内容颜色
@property (nonatomic, strong) UIColor *contentColor;

/// 左侧标题字体
@property (nonatomic, strong) UIFont *leftFont;

/// 内容字体
@property (nonatomic, strong) UIFont *contentFont;


/// 有无必填*标志 3:有 3-1:无  默认：NO
@property (nonatomic, assign) BOOL isHasMustSigns;

/// 是否显示箭头，默认NO
@property (nonatomic, assign) BOOL showArrow;


/// 表单对应的字段
@property (nonatomic, copy) NSString *tableKey;

/// cell样式的类型
@property (nonatomic, assign) GDFiterCellType cellType;

/// cell注册类型，默认GDFiterCellRegisterByClass
@property (nonatomic, assign) GDFiterCellRegisterType registType;

/// cell class类型
@property (nonatomic, strong) Class cellKlass;

/// cell 唯一标识
@property (nonatomic, strong) NSString *cellId;

/// 是否添加注册cell，默认GDCellDisplayShow
@property (nonatomic, assign) GDCellDisplayType cellDisplayType;


/// 文本内容
@property (nonatomic, copy) NSString *text;

/// 站位文字
@property (nonatomic, copy) NSString *placeHolder;


#pragma mark - cell数据
/// 与某个cell有关联的操作时，该值记录对应cell的indexrow
@property (nonatomic, assign) NSInteger bindingRowIndex;

@property (nonatomic, strong) id bindingData;

@property (nonatomic, strong) id cellData;

/// 对应点击cell需要跳转的vc
@property (nonatomic, strong) Class nextVCClass;

#pragma mark - textField 属性

/**
 设置弹出键盘类型
 */
@property (nonatomic, assign) UIKeyboardType keyboardType;

@property (nonatomic, assign) BOOL enable;


#pragma mark - picker 属性

///// 外部操作，禁止点击弹出默认picker，等待外部数据填充完毕，再在didselecte方法中 手动写代码弹出picker
//@property (nonatomic, assign) BOOL isExternalOperation;

/// pick数据源
@property (nonatomic, strong) NSArray *pickerDataArray;

/// pick是否可点击弹出视图
@property (nonatomic, assign) BOOL isCloesPK;

/// pick的类型
@property (nonatomic, assign) GDPickerType pickerType;

/// pickerUI 日期格式显示类型
@property (nonatomic, assign) BRDatePickerMode pickerDateType;

/// 最小日期时间
@property (nonatomic, strong) NSDate *minDate;

/// 最大日期时间
@property (nonatomic, strong) NSDate *maxDate;


/// pick默认选中的行(单列传字符串，多列传一维数组)
@property (nonatomic, strong) id pickerDefulteSelValue;

///  cell高度
@property (nonatomic, assign) CGFloat cellHeight;


#pragma mark - 图片 / 视频上传设置属性

/// 图片
@property (nonatomic, strong) NSArray *images;

/// 设置最大添加图片数目 默认 9
@property (nonatomic, assign) NSInteger maxImgNum;

/// 设置行显示数量 默认 3
@property (nonatomic, assign) NSInteger lineNum;

/// 图片上下左右间隔 默认10
@property (nonatomic, assign) CGFloat spacing;

/// 设置可选图片 视频类型  默认 图片
@property (nonatomic, assign) GDCellPhotoManagerSelectedType photoMangeType;




/// 设置图片cell高度
@property (nonatomic, assign) CGFloat ImgHeight;

/// radio的标题数组  >>> 默认 是：否
@property (nonatomic, strong) NSArray *radioTitleArray;

/* ************** */
/* 👉： imagesKey和photoUrlsKey 2个字段必加，不然会crash key为nil， -->为解决这问题，本类为这2个字段设置默认key */
/**
 记录被选中的图片 - UIImage
 👉：--> 上传被选择图片，使用该数组。
 */
@property (nonatomic, strong) NSString *imagesKey;

/**
 记录cell图片集合 - 图片路径
 👉：--> 仅为PhotoView初始化提供 已知图集，设置还能选择多少图片。 无其他功能
 
 ⚠️： 当localImagesKey和photoUrlsKey 都定义了时，优先使用photoUrlsKey
 */
@property (nonatomic, strong)  NSString *photoUrlsKey;

/**
 记录cell图片集合 - UIImage 图片集合
 👉：--> 仅为PhotoView初始化提供 已知图集，设置还能选择多少图片。 无其他功能
 */
@property (nonatomic, strong)  NSString *localImagesKey;


- (CGFloat)getCollectionHeight:(UICollectionView *)collectionView;


@end
